import request from '@/utils/request'

export function getList(url, param) {
  return request({
    url: url,
    method: 'post',
    data: param
  })
}

export function getEntity(url, param) {
  return request({
    url: url + param,
    method: 'get'
  })
}

export function addEntity(url, param) {
  return request({
    url: url,
    method: 'post',
    data: param
  })
}

export function editEntity(url, param) {
  return request({
    url: url,
    method: 'put',
    data: param
  })
}

export function deleteEntity(url, param) {
  return request({
    url: url + param,
    method: 'delete'
  })
}

export function deleteEntities(url, param) {
  return request({
    url: url + param,
    method: 'delete'
  })
}

export function exportFile(url, param) {
  return request({
    url: url,
    method: 'get',
    param: param,
    responseType: 'blob'
  })
}

export function post(url, param) {
  return request({
    url: url,
    method: 'post',
    data: param
  })
}

export function get(url, param) {
  return request({
    url: url,
    method: 'get',
    param: param
  })
}
